
#ifndef __SUPERVISOR_H__
#define __SUPERVISOR_H__

#include <webots/Robot.hpp>
#include <vector>

#include "constants.h"

using namespace webots;

class DemoSupervisor : public Robot{
public:
    DemoSupervisor (int argc, char **argv) {
        if(argc <= 1){
            std::cerr << "Not enough parameters for this controller" << std::endl;
            std::cerr << "Please set the parameter string" << std::endl;
        }
        this->argc = argc;
        this->argv = argv;
    }
    
    virtual ~DemoSupervisor() {
    }
    
    virtual void run() {
        if(!initialise(argc,argv)){
            return;
        }
        do {
            controlStep();
        } while (step(TIMESTEP) != -1);
    }
    
	virtual void controlStep() = 0;
	virtual bool initialise(int argc, char **argv) = 0;
    
private:
    int argc;
    char **argv;
};

#endif
